package rexsee.instrumentation;

import rexsee.core.browser.Browser;
import rexsee.core.browser.clazz.JavascriptInterface;
import android.app.Instrumentation;

public class RexseeInstrumentation extends Instrumentation
		implements
			JavascriptInterface {

	public static final String INTERFACE_NAME = "Instrumentation";
	@Override
	public String getInterfaceName() {
		return mBrowser.application.resources.prefix + INTERFACE_NAME;
	}
	@Override
	public JavascriptInterface getInheritInterface(Browser childBrowser) {
		return this;
	}
	@Override
	public JavascriptInterface getNewInterface(Browser childBrowser) {
		return this;
	}

	private final Browser mBrowser;

	public RexseeInstrumentation(Browser browser) {
		mBrowser = browser;
	}

	public void sendKey(int keyCode) {
		this.sendKeyDownUpSync(keyCode);
	}

}
